﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Steve.UI.Models;
using System.ComponentModel.Composition;
using Microsoft.ComponentModel.Composition.Extensions.Web;
using Steve.UI.Administration.Controllers;
using Steve.UI.Administration.Models;

namespace Steve.UI.Site.Controllers
{
    [SiteMasterData]
    [Authorize(Roles = "Steve-Url Writer, Steve-Url Reader, Steve-Sys Admin")]
    [Export(typeof(IController))]
    [ExportMetadata("Name", "UrlManagement")]
    [ExportMetadata("Mode", WebScopeMode.Request)]
    [PartCreationPolicy(CreationPolicy.NonShared)]
    public sealed class UrlManagementController : UrlManagementControllerBase
    {
        [Authorize(Roles = "Steve-Url Writer, Steve-Sys Admin")]
        public override ActionResult RewriteUrlDetailPost(ExistingUrlRewriteDetailModel model, Guid id)
        {
            return base.RewriteUrlDetailPost(model, id);
        }

        [Authorize(Roles = "Steve-Url Writer, Steve-Sys Admin")]
        public override ActionResult RewriteUrlDetailPost(NewUrlRewriteDetailModel model)
        {
            return base.RewriteUrlDetailPost(model);
        }

        [Authorize(Roles = "Steve-Url Writer, Steve-Sys Admin")]
        public override ActionResult SiteUrlDetailPost(ExistingSiteUrlDetailModel model, Guid id)
        {
            return base.SiteUrlDetailPost(model, id);
        }

        [Authorize(Roles = "Steve-Url Writer, Steve-Sys Admin")]
        public override ActionResult SiteUrlDetailPost(NewSiteUrlDetailModel model)
        {
            return base.SiteUrlDetailPost(model);
        }
    }
}